<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>APP发布系统</title>
    <script src="common/js/jquery.min.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="apps_res/homepage/css/index.css" />
    <script type="text/javascript" src="apps_res/homepage/js/index.js"></script>
</head>
<body>
<div id="app">
    <div class="head">
        <a v-if="!isLogin" class="login-text-span" href="/login.html">
            <div class="login-wrap-div">
                <div class="login-img-div">
                    <img class="login-img" src="common/images/login-btn.png" />
                </div>
                <div class="login-text-div">
                    登录
                </div>
            </div>
        </a>
        <a v-if="isLogin" class="login-text-span"
           href="<%=request.getContextPath()%>/customerAction?method=queryAllCustAndApp">
            <div class="login-wrap-div">
                <div class="login-img-div">
                    <img class="login-img" src="common/images/user.png" />
                </div>
                <div class="login-text-div">
                    客户管理
                </div>
            </div>
        </a>
        <!--公司名-->
        <div class="account-name-div">
        <span>
            APP发布系统
        </span>
        </div>
    </div>
    <div id="content">
        <div id="live_box">
            <dl>
                <dd>
                    <ul id="custer-ul">
                        <li v-for="cust in custList" :class="{one:$index%4==0,four:$index%4==3}">
                            <!--<a :href="'/appAction?method=download&custId='+cust.id">-->
                            <a :href="'download.html?custId='+cust.id">
                                <img :src="cust.logoUrl" width="240" height="120" :alt="cust.custName">
                            </a>
                            <span><a href="#">{{cust.custName}}}</a></span>
                        </li>
                    </ul>
                </dd>
            </dl>
        </div>
    </div>
</div>
</body>
<script src="http://apps.bdimg.com/libs/vue/1.0.14/vue.js"></script>
<script>
    var custList = [];
    var isLogin = false;
    //获取数据
    $.ajax(
        {
            url: "/homePageAction",
            dataType: "json",
            async: false,
            data: {method: "home"},
            method: "post",
            success: function (result) {
                if (result.success) {
                    custList = result.obj.custList;
                    isLogin = result.obj.isLogin == true ? true : false;
                } else {
                    alert(result.errMsg);
                }
            }
        }
    );
    var vm = new Vue({
        el: '#app',
        data: {
            custList: custList,
            isLogin: isLogin
        }
    })
</script>
</html>